using Lcygcc.Infrastructure.Utility.IOC;
using System;
using System.Collections.Generic;
using System.Reflection;
namespace JSOCTNet.Entities.Core
{
	public class WebAppTypeFinder : AppDomainTypeFinder
	{
		private bool _ensureBinFolderAssembliesLoaded = true;
		private bool _binFolderAssembliesLoaded;
		public bool EnsureBinFolderAssembliesLoaded
		{
			get
			{
				return this._ensureBinFolderAssembliesLoaded;
			}
			set
			{
				this._ensureBinFolderAssembliesLoaded = value;
			}
		}
		public virtual string GetBinDirectory()
		{
			return AppDomain.CurrentDomain.BaseDirectory;
		}
		public override IList<Assembly> GetAssemblies()
		{
			if (this.EnsureBinFolderAssembliesLoaded && !this._binFolderAssembliesLoaded)
			{
				this._binFolderAssembliesLoaded = true;
				string binDirectory = this.GetBinDirectory();
				this.LoadMatchingAssemblies(binDirectory);
			}
			return base.GetAssemblies();
		}
	}
}
